<?php
class NewsAction extends Action{
	public function index(){
		$News=M('Page_notice');
		$this->news=$News->where("disable='f'")->order('time desc')->select();

		$this->user=$_SESSION['euname'];
		$this->cat=R('Goods/goods_cat');
		$shop_cart=cookie('shopcart');
		$this->cart_num=!empty($shop_cart)?count(unserialize(stripslashes($shop_cart))):0;
		$this->name=C('WEB_NAME');
		$this->display();
	}

	public function view(){
		$News=M('Page_notice');
		$map['id']=$this->_get('id');
		$this->detail=$News->where($map)->find();
		$this->news=$News->where("disable='f'")->order('time desc')->select();

		$this->user=$_SESSION['euname'];
		$this->cat=R('Goods/goods_cat');
		$shop_cart=cookie('shopcart');
		$this->cart_num=!empty($shop_cart)?count(unserialize(stripslashes($shop_cart))):0;
		$this->name=C('WEB_NAME');
		$this->display();
	}


}
?>